package concurrency.basicthreading.demo;
import java.util.concurrent.TimeUnit;


public class Demo09Daemons {

	public static void main(String[] args) throws Exception {
		Thread d = new Thread(new Demo09Daemon());
		//如果一个线程是后台线程，那么由该线程创建出来的任何线程都将被自动设置为后台线程。
		d.setDaemon(true);
		d.start();
		System.out.println("d.isDaemon() = " + d.isDaemon() + ".");
		TimeUnit.SECONDS.sleep(1);
	}
}
